package com.hksj.common.core.enums;

public enum DeviceLogType {
    event("事件上报"),
    readProperty("读取属性"),
    writeProperty("修改属性"),
    writePropertyReply("修改属性回复"),
    reportProperty("属性上报"),
    readPropertyReply("读取属性回复"),
    child("子设备消息"),
    childReply("子设备消息回复"),
    functionInvoke("调用功能"),
    functionReply("调用功能回复"),
    register("设备注册"),
    unregister("设备注销"),
    log("日志"),
    tag("标签更新"),
    offline("离线"),
    online("上线"),
    other("其它");

    private final String text;

    DeviceLogType(String text) {
        this.text = text;
    }

    public String getValue() {
        return name();
    }

    public String getText(String name){
        for (DeviceLogType deviceLogType : DeviceLogType.values()) {
            if (deviceLogType.name().equals(name)) {
                return deviceLogType.text;
            }
        }
        return null;
    }
}
